package org.dolphin.entity.promo;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import org.dolphin.entity.inventory.Product;
import org.hibernate.annotations.ForeignKey;

@Entity
@Table(name = "MS_SEASONAL_PROMOTION_PRODUCT")
@PrimaryKeyJoinColumn(name = "ID", referencedColumnName = "ID")
@ForeignKey(name = "FK_MS_SEASONAL_PROMOTION_PRODUCT_ID")
public class ProductSeasonalPromotion extends SeasonalPromotion {
  private static final long serialVersionUID = -1949768401545516508L;
  private Product product;

  @ManyToOne(fetch = FetchType.LAZY, optional = false)
  @JoinColumn(name = "PRODUCT_ID")
  @ForeignKey(name = "FK_MS_SEASONAL_PROMOTION_PRODUCT_PRODUCT_ID")
  public Product getProduct() {
    return product;
  }

  public void setProduct(Product product) {
    this.product = product;
  }
}
